
import {reqcatelist} from "../../request/api"
const state={
    list:[]
}

const getters={
    list(state){
        return state.list
    }
}

const mutations={
    changelist(state,list){
        state.list=list
    }
}

const actions={
    reqlist(context){
        reqcatelist({istree: true}).then(res=>{
            if(res.data.code==200){
                let list=res.data.list?res.data.list:[]
                context.commit("changelist",list)
            }
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    namespaced: true
}